﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaseDao
{
    public interface IBaseProvider<T>
        where T : TBaseModel
    {
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool Add(T model);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool RemoveById(long id);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool Update(T model);

        /// <summary>
        /// 根据Id获取内容对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T GetItemById(long id);

        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns></returns>
        List<T> GetAll();

        /// <summary>
        /// 根据Id列表获取数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        List<T> GetListByIds(List<long> ids);
    }

}
